<template>
	<view class="page">
		<view class="header">
			<img src="@/static/ke_hu/Indo2x.png" alt="" style="width: 100%;height: 100%;" class="headerbgc">
			<div class="headerContent">
				<div class="headerLeft">
					<img src="@/static/ke_hu/modi.jpg" alt="" style="width: 100%;height: 100%;" >
					<!-- <img :src="avatar" alt="" style="width: 100%;height: 100%;border-radius: 50%;" v-if="avatar!=''"> -->
				</div>
				<div class="headerRight">
					{{phoneNumber || ''}}
				</div>
			</div>
		</view>
		<view class="items" style="margin-top: 40rpx;" @click="weiMo">
			<view class="items_title">
				<img src="@/static/ke_hu/Frame.png" alt="" style="width: 80rpx;height: 80rpx;">
				<view>
					关于微摩汇
				</view>
			</view>
			<u-icon name="arrow-right" color="#AFAFAF" size="20" style="margin-right: 20rpx;"></u-icon>
		</view>
		<view class="items" v-if="!isYinhangOrKehu" style="margin-top: 40rpx;" @click="chedaijisuanqi">
			<view class="items_title">
				<img src="@/static/ke_hu/Frame.png" alt="" style="width: 80rpx;height: 80rpx;">
				<view>
					车贷计算器
				</view>
			</view>
			<u-icon name="arrow-right" color="#AFAFAF" size="20" style="margin-right: 20rpx;"></u-icon>
		</view>
		<view class="items" style="margin-top: 40rpx;" @click="yinhangdingdan" v-if="showBankOrderList">
			<view class="items_title">
				<img src="@/static/ke_hu/Frame.png" alt="" style="width: 80rpx;height: 80rpx;">
				<view>
					我的订单
				</view>
			</view>
			<u-icon name="arrow-right" color="#AFAFAF" size="20" style="margin-right: 20rpx;"></u-icon>
		</view>
		
		<view v-if="isOpen==true" class="items" style="margin-top: 40rpx;" @click="this.$next('/pages/ge_ren_zhong_xin/jing_xiao_shang_ru_zhu')">
			<view class="items_title">
				<img src="@/static/ke_hu/Frame2.png" alt="" style="width: 80rpx;height: 80rpx;">
				<view>
					经销商入驻
				</view>
			</view>
			<u-icon name="arrow-right" color="#AFAFAF" size="20" style="margin-right: 20rpx;"></u-icon>
		</view>
	
	</view>
</template>

<script>
	import registerOrLogin from '@/utils/mixin/registerOrLogin.js' //引入注册登录混入
	export default {
		mixins: [registerOrLogin], // 使用混入
		data() {
			return {
				isOpen: false,
				showBankOrderList: false,
				isYinhangOrKehu: false,
			}
		},
		created() {
			this.phoneNumber = uni.getStorageSync('account');
			this.avatar = uni.getStorageSync('avatar');
			var role = uni.getStorageSync('roles')
			if (role && role.includes("银行客户经理")) {
				this.showBankOrderList = true
				this.isYinhangOrKehu=true
			}
			else if(role && role.includes("customer")) {
				this.isYinhangOrKehu=true
			}
			this.jingxiaoshangruzhuOpen()
		},
		onShow() {
			
		},
		methods: {
			async jingxiaoshangruzhuOpen() {
				const res = await this.$get(`/biz/ClientPersonal/isOpenController`, {})
				if (res.status) {
					this.isOpen = res.data.data
				}
			},
			yinhangdingdan() {
				uni.navigateTo({
					url: '/pages/yin_hang/wo_de_ding_dan'
				})
			},
			// 产品问题
			chanPing() {
				uni.navigateTo({
					url: '/pages/ke_hu_duan/wo_de_shen_qing/chanPingWenTi'
				})
			},
			chedaijisuanqi() {
				uni.navigateTo({
					url: '/pages/che_dai_ji_suan_qi/che_dai_ji_suan_qi'
				})
			},
			weiMo() {
				uni.navigateTo({
					url: '/pages/ke_hu_duan/wo_de_shen_qing/wei_mo_hui'
				})
			},
		}
	}
</script>

<style lang="less">
	.page {
		overflow-y: hidden;
		padding: 0 32rpx;
		box-sizing: border-box;
		width: 100%;
		height: 100vh;
		background-color: #fff;
	}
	.header {
		position: relative;
		width: 100%;
		height: 144rpx;
		border-radius: 20rpx;
		background-color: cadetblue;
		margin-top: 40rpx;
		
	}
	.headerbgc {
		position: absolute;
		left: 0;
		top: 0;
		z-index: 0;
	}
	.headerContent {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		width: 100%;
		height: 100%;
		position: absolute;
		left: 0;
		right: 0;
	}
	.headerLeft {
		width: 80rpx;
		height: 80rpx;
		border-radius: 40rpx;
		overflow: hidden;
		background-color: #1D1C47;
		margin: 0 30rpx 0 30rpx;
	}
	.headerRight {
		font-size:32rpx;
		font-weight:400;
		letter-spacing:0;
		line-height:25rpx;
		color: rgba(255, 255, 255, 1);
	}
	.title {
		height: 48rpx;
		font-size: 34rpx;
		font-family: "PingFang SC-Bold, PingFang SC";
		font-weight: bold;
		color: #2B2B2B;
		line-height: 0rpx;
		margin-top: 108rpx;
		text-align: center;
	}

	.tou_xiang {
		width: 200rpx;
		height: 200rpx;
		border-radius: 50%;
		margin: 37rpx auto 0;
	}

	.items {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 690rpx;
		height: 97rpx;
		margin: 122rpx auto 0;
		// border-bottom: 2rpx solid #F4F4FA;
	}

	.items_title {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		font-size: 32rpx;
		font-family: 'PingFang SC-Regular, PingFang SC';
		font-weight: 400;
		color: rgba(22, 22, 22, 1);
	}
	.items_title img {
		margin-right: 40rpx;
	}
	.submit {
		position: fixed;
		left: 53rpx;
		bottom: 103rpx;
	}

	.phoneNumber {
		text-align: center;
		font-size: 29rpx;
		font-family: "Samsung Sharp Sans-Bold, Samsung Sharp Sans";
		font-weight: bold;
		margin: 25rpx auto 0;
		color: #1D1C47;
	}

	.fenGe {
		width: 690rpx;
		height: 15rpx;
		background: #F4F4FA;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx auto 24rpx;
	}
</style>